'''
Author: maolele02
Date: 2022-11-17 21:22:34
LastEditTime: 2023-03-03 16:21:27
LastEditors: maolele02
Description: 
FilePath: \beidou\mysql_config.py
'''
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()
HOST = '127.0.0.1'
PORT = '3306'
USERNAME = 'cheng'
PASSWORD = 'cheng'
DATABASE = 'beidou'
# DB_URI = 'MySQL+PyMySQL://{username}:{password}' \
#          '@{host}:{port}/{db}?charset-utf8'.format(
#             username=USERNAME,
#             password=PASSWORD,
#             host=HOST,
#             port=PORT,
#             db=DATABASE
#             )
DB_URI = 'mysql+pymysql://{username}:{password}' \
         '@{host}:{port}/{db}?charset-utf8'.format(
            username=USERNAME,
            password=PASSWORD,
            host=HOST,
            port=PORT,
            db=DATABASE
            )
SQLALCHEMY_DATABASE_URI = DB_URI  # 数据库连接的实例化
SQLALCHEMY_TRACK_MODIFICATIONS = False  # 关闭动态追踪
SQLALCHEMY_ECHO = False  # 查询时显示原始SQL语句
